import java.util.Iterator;
import java.util.List;

/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: InfoColleageIterator
 * @author: xiayuanxing
 * @description: TODO
 * @date: 2022/1/7 11:37
 * @version: 1.0
 */
public class InfoColleageIterator implements Iterator {


    /**信息工程学院是以list方式存放系*/
    List<Department> departmentList;
    //索引
    int index = -1;

    /**构造器*/
    public InfoColleageIterator(List<Department> departmentList) {
        this.departmentList = departmentList;
    }


    public boolean hasNext() {
        if (index >= departmentList.size()-1){
            return false;
        }else {
            index +=1;
            return true;
        }
    }

    public Object next() {
        return departmentList.get(index);
    }

    /**空实现*/
    public void remove() {

    }
}
